package com.shg.web.ztest;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.shg.bean.bbs.FavoriteItem;
import com.shg.service.bbs.FavoriteService;

public class FavoriteServiceTest {

	static FavoriteService favoriteService;
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		ApplicationContext context=new ClassPathXmlApplicationContext("basics-application.xml");
		favoriteService = (FavoriteService) context.getBean("favoriteServiceBean");
	}

	@Test
	public void addBookTest(){
		try {
			FavoriteItem favoriteItem=new FavoriteItem();
			favoriteItem.setId("297ec0763903d54e01390409926d0000");
			favoriteItem.setType(100);
			favoriteService.insertBook("297ec07638fc101b0138fc147f230000", favoriteItem);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	@Test
	public void getBook(){
		try {
			favoriteService.getBook("297ec07638fc101b0138fc147f230000");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
}
